- QColor aColor = QColorDialog::getColor( aView->backgroundColor(), aView);
- if ( aColor.isValid() )
- aView->setBackgroundColor(aColor);
+ // get supported gradient types
+ QStringList gradList;
+ QIntList idList, txtList;
+ QString formats = backgroundData( gradList, idList, txtList );
+
+ // invoke dialog box
+ Qtx::BackgroundData bgData = QtxBackgroundDialog::getBackground( aView->background(), // initial background
+ aView, // parent for dialog box
+ txtList, // allowed texture modes
+ true, // enable solid color mode
+ true, // enable gradient mode
+ false, // disable custom gradient mode
+ !txtList.isEmpty(), // enable texture mode
+ gradList, // gradient names
+ idList, // gradient identifiers
+ formats ); // image formats
+
+ // set chosen background data to the viewer
+ if ( bgData.isValid() )
+ aView->setBackground( bgData );