示例#1
0
文件: qwt_slider.cpp 项目: Aconex/pcp
/*!
  \brief Constructor
  \param parent parent widget
  \param orientation Orientation of the slider. Can be Qt::Horizontal
         or Qt::Vertical. Defaults to Qt::Horizontal.
  \param scalePos Position of the scale.
         Defaults to QwtSlider::NoScale.
  \param bgStyle Background style. QwtSlider::Trough draws the
         slider button in a trough, QwtSlider::Slot draws
         a slot underneath the button. An or-combination of both
         may also be used. The default is QwtSlider::Trough.

  QwtSlider enforces valid combinations of its orientation and scale position.
  If the combination is invalid, the scale position will be set to NoScale.
  Valid combinations are:
  - Qt::Horizonal with NoScale, TopScale, or BottomScale;
  - Qt::Vertical with NoScale, LeftScale, or RightScale.
*/
QwtSlider::QwtSlider( QWidget *parent,
        Qt::Orientation orientation, ScalePos scalePos, 
        BackgroundStyles bgStyle ):
    QwtAbstractSlider( orientation, parent )
{
    initSlider( orientation, scalePos, bgStyle );
}
示例#2
0
void CreaturePurchaseCard::initView()
{
	picture = std::make_shared<CCreaturePic>(pos.x, pos.y, creatureOnTheCard);
	background = std::make_shared<CPicture>("QuickRecruitmentWindow/CreaturePurchaseCard.png", pos.x-4, pos.y-50);
	initAmountInfo();
	initSlider();
	initButtons();
	initCostBox();
}
void MusicEqualizerDialog::init()
{
    m_signalMapper = new QSignalMapper(this);
    initSlider(ui->verticalSlider1, 0);
    initSlider(ui->verticalSlider2, 1);
    initSlider(ui->verticalSlider3, 2);
    initSlider(ui->verticalSlider4, 3);
    initSlider(ui->verticalSlider5, 4);
    initSlider(ui->verticalSlider6, 5);
    initSlider(ui->verticalSlider7, 6);
    initSlider(ui->verticalSlider8, 7);
    initSlider(ui->verticalSlider9, 8);
    initSlider(ui->verticalSlider10, 9);
    initSlider(ui->bwVerticalSlider, 10);
    connect(m_signalMapper, SIGNAL(mapped(int)), SLOT(verticalSliderChanged(int)));

    connect(ui->showEqButton, SIGNAL(clicked()), SLOT(setEqEnable()));
    connect(ui->resetButton, SIGNAL(clicked()), SLOT(resetEq()));
    ui->resetButton->setStyleSheet(MusicUIObject::MPushButtonStyle08);

#ifdef Q_OS_UNIX
    MusicUtils::setLabelFont(ui->showPerArea_21, 9);
    MusicUtils::setLabelFont(ui->showPerArea_22, 9);
    MusicUtils::setLabelFont(ui->showPerArea_23, 9);
    MusicUtils::setLabelFont(ui->showPerArea_24, 9);
    MusicUtils::setLabelFont(ui->showPerArea_25, 9);
    MusicUtils::setLabelFont(ui->showPerArea_26, 9);
    MusicUtils::setLabelFont(ui->showPerArea_27, 9);
    MusicUtils::setLabelFont(ui->showPerArea_28, 9);
    MusicUtils::setLabelFont(ui->showPerArea_29, 9);
    MusicUtils::setLabelFont(ui->showPerArea_30, 9);
    MusicUtils::setLabelFont(ui->showPerArea_31, 9);
#endif
}
示例#4
0
/*!
  \brief Constructor

  Build a horizontal slider with no scale and BgTrough as 
  background style

  \param parent parent widget
  \param name Object name
*/
QwtSlider::QwtSlider(QWidget *parent, const char* name):
    QwtAbstractSlider(Qt::Horizontal, parent)
{
    setName(name);
    initSlider(Qt::Horizontal, NoScale, BgTrough);
}
示例#5
0
/*!
  Construct a slider in QwtSlider::Trough style

  When orientation is Qt::Vertical the scale will be aligned to
  the left - otherwise at the the top of the slider.

  The scale is initialized to [0.0, 100.0] and the value set to 0.0.

  \param parent Parent widget
  \param orientation Orientation of the slider. 
*/
QwtSlider::QwtSlider( Qt::Orientation orientation, QWidget *parent ):
    QwtAbstractSlider( parent )
{
    initSlider( orientation );
}
示例#6
0
/*!
  Construct vertical slider in QwtSlider::Trough style
  with a scale to the left. 

  The scale is initialized to [0.0, 100.0] and the value set to 0.0.

  \param parent Parent widget

  \sa setOrientation(), setScalePosition(), setBackgroundStyle()
*/
QwtSlider::QwtSlider( QWidget *parent ):
    QwtAbstractSlider( parent )
{
    initSlider( Qt::Vertical );
}
示例#7
0
SVGSlider::SVGSlider() {
  lineColor = vec3(.4);
  sliderKnobColor = vec3(1);
  sliderKnobOutlineColor = vec3(0);
  initSlider();
}
void PeopleApplication::createPeoplePage()
{

    //m_AccountManager = AccountManger::getInstance();
    m_mainPage = new MApplicationPage;
    m_mainPage->setTitle(QObject::tr("People","Title of the application"));

    QGraphicsLinearLayout *linear = new QGraphicsLinearLayout(Qt::Vertical);
    linear->setContentsMargins(0, 0, 0, 0);
    linear->setSpacing(0);
    m_mainPage->centralWidget()->setLayout(linear);

    m_topSpacer = new QGraphicsWidget;
    m_topSpacer->setPreferredHeight(0);
    linear->addItem(m_topSpacer);

    m_people = new SeasidePeople;
    linear->addItem(m_people);

    m_bottomSpacer = new QGraphicsWidget;
    m_bottomSpacer->setPreferredHeight(0);
    linear->addItem(m_bottomSpacer); 

    m_actionSearch = new MAction(QObject::tr("Search","Menu action to bring up search for contact list"), this);
    m_actionSearch->setLocation(MAction::ApplicationMenuLocation);
    m_mainPage->addAction(m_actionSearch);
    connect(m_actionSearch, SIGNAL(triggered()), this, SLOT(searchClicked()));

    m_actionAdd = new MAction(QObject::tr("Add Contact","Menu action to add contact"), this);
    m_actionAdd->setLocation(MAction::ApplicationMenuLocation);
    m_mainPage->addAction(m_actionAdd);
    connect(m_actionAdd, SIGNAL(triggered()), this, SLOT(addNewContact()));

    m_actionAll = new MAction(QObject::tr("<b>Show All</b>","Menu filter to show all contacts"), this);  
    m_actionAll->setLocation(MAction::ApplicationMenuLocation);
    m_actionAll->setObjectName("ShowAllFilter");
    m_actionAll->setCheckable(true);
    connect(m_actionAll, SIGNAL(triggered()), m_people, SLOT(filterAll()));

    m_actionFav = new MAction(QObject::tr("Show Favorites", "Menu filter to show all contacts marked as favorites"), this);
    m_actionFav->setLocation(MAction::ApplicationMenuLocation);
    m_actionFav->setObjectName("ShowFavoritesFilter");
    m_actionFav->setCheckable(true);
    connect(m_actionFav, SIGNAL(triggered()), m_people, SLOT(filterFavorites()));

    m_actionRecent = new MAction(QObject::tr("Show Recent","Menu filter to show all contacts with recent communications"), this);
    m_actionRecent->setLocation(MAction::ApplicationMenuLocation);
    m_actionRecent->setCheckable(true);
    m_actionRecent->setObjectName("ShowRecentFilter");
    connect(m_actionRecent, SIGNAL(triggered()), m_people, SLOT(filterRecent()));

    m_actionFilters = new QActionGroup(this);
    m_actionFilters->addAction(m_actionAll);
    m_actionFilters->addAction(m_actionRecent);
    m_actionFilters->addAction(m_actionFav);
    m_actionFilters->setExclusive(true);
    m_mainPage->addActions(m_actionFilters->actions());
    connect(m_actionFilters, SIGNAL(triggered(QAction*)), this, SLOT(menuFilterSelected(QAction*)));

    connect(m_people, SIGNAL(itemClicked(QModelIndex)),
            this, SLOT(createDetailPage(QModelIndex)));
    connect(m_people, SIGNAL(editRequest(QModelIndex)),
            this, SLOT(createEditPage(QModelIndex)));

    connect(m_people, SIGNAL(callNumber(const QString&)),
            this, SLOT(callNumber(const QString&)));
    connect(m_people, SIGNAL(composeSMS(const QString&)),
            this, SLOT(composeSMS(const QString&)));
    connect(m_people, SIGNAL(composeIM(const QString&)),
            this, SLOT(composeIM(const QString&)));
    connect(m_people, SIGNAL(composeEmail(const QString&)),
            this, SLOT(composeEmail(const QString&)));

    m_mainPage->appear();

    initSlider();
    initSearch();
    repositionOverlays();
}
示例#9
0
Window::Window(int argc, char *argv[]) :
    QMainWindow(NULL),
    ui(new Ui::Window)
{
    ui->setupUi(this);

	// Cache size
	cacheSize = 50;
	cachePos  = 0;

	prefs = new Preferences(this);
    about = new AboutDialog(this);

    connect(prefs, SIGNAL(finished(int)), this, SLOT(updatePrefs()));

    initSlider(ui->xSlider);
    initSlider(ui->ySlider);
    initSlider(ui->zSlider);
    initSpanSlider(ui->xSpanSlider);
    initSpanSlider(ui->ySpanSlider);
    initSpanSlider(ui->zSpanSlider);

	// Rotation
    connect(ui->xSlider,  SIGNAL(valueChanged(int)),     ui->viewport, SLOT(setXRotation(int)));
    connect(ui->viewport, SIGNAL(xRotationChanged(int)), ui->xSlider, SLOT(setValue(int)));
    connect(ui->ySlider,  SIGNAL(valueChanged(int)),     ui->viewport, SLOT(setYRotation(int)));
    connect(ui->viewport, SIGNAL(yRotationChanged(int)), ui->ySlider, SLOT(setValue(int)));
    connect(ui->zSlider,  SIGNAL(valueChanged(int)),     ui->viewport, SLOT(setZRotation(int)));
    connect(ui->viewport, SIGNAL(zRotationChanged(int)), ui->zSlider, SLOT(setValue(int)));

	// Slicing
    connect(ui->xSpanSlider, SIGNAL(lowerValueChanged(int)), ui->viewport, SLOT(setXSliceLow(int)));
    connect(ui->xSpanSlider, SIGNAL(upperValueChanged(int)), ui->viewport, SLOT(setXSliceHigh(int)));
    connect(ui->ySpanSlider, SIGNAL(lowerValueChanged(int)), ui->viewport, SLOT(setYSliceLow(int)));
    connect(ui->ySpanSlider, SIGNAL(upperValueChanged(int)), ui->viewport, SLOT(setYSliceHigh(int)));
    connect(ui->zSpanSlider, SIGNAL(lowerValueChanged(int)), ui->viewport, SLOT(setZSliceLow(int)));
    connect(ui->zSpanSlider, SIGNAL(upperValueChanged(int)), ui->viewport, SLOT(setZSliceHigh(int)));

    ui->animSlider->setRange(0, 10);
    ui->animSlider->setSingleStep(1);
    ui->animSlider->setPageStep(10);
    ui->animSlider->setTickInterval(2);
    ui->animSlider->setTickPosition(QSlider::TicksRight);
    ui->animSlider->setEnabled(false);

    // Actions
    connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(openAbout()));
    connect(ui->actionPreferences, SIGNAL(triggered()), this, SLOT(openSettings()));
    connect(ui->actionFiles, SIGNAL(triggered()), this, SLOT(openFiles()));
    connect(ui->actionDir, SIGNAL(triggered()), this, SLOT(openDir()));

    connect(ui->actionCubes,   SIGNAL(triggered()), this, SLOT(toggleDisplay()));
    connect(ui->actionCones,   SIGNAL(triggered()), this, SLOT(toggleDisplay()));
    connect(ui->actionVectors, SIGNAL(triggered()), this, SLOT(toggleDisplay()));

    displayType = new QActionGroup(this);
    displayType->addAction(ui->actionCubes);
    displayType->addAction(ui->actionCones);
    displayType->addAction(ui->actionVectors);
    ui->actionCubes->setChecked(true);

    signalMapper = new QSignalMapper(this);
    signalMapper->setMapping (ui->actionFollow, "") ;
    connect (signalMapper, SIGNAL(mapped(QString)), this, SLOT(watchDir(QString))) ;
    connect(ui->actionFollow, SIGNAL(triggered()), signalMapper, SLOT(map()));

    ui->xSlider->setValue(15 * 16);
    ui->ySlider->setValue(345 * 16);
    ui->zSlider->setValue(0 * 16);
	setWindowTitle(tr("MuView 0.9"));

	// Data, don't connect until we are ready (probably still not ready here)...
    connect(ui->animSlider, SIGNAL(valueChanged(int)), this, SLOT(updateDisplayData(int)));
	
	// Load files from command line if supplied
	if (argc > 1) {
		QStringList rawList;
		for (int i=1; i<argc; i++) {
			rawList << argv[i];
		}

		if (rawList.contains(QString("-w"))) {
			if (rawList.indexOf("-w") < (rawList.length() - 1))  {
				watchDir(rawList[rawList.indexOf("-w")+1]);
			}
		} else {
			QStringList allLoadedFiles;
			foreach (QString item, rawList)
			{
				QFileInfo info(item);
				if (!info.exists()) {
					std::cout << "File " << item.toStdString() << " does not exist" << std::endl;
				} else {
								// Push our new content...
					if (info.isDir()) {
						QDir chosenDir(item);
						dirString = chosenDir.path()+"/";
						QStringList filters;
						filters << "*.omf" << "*.ovf";
						chosenDir.setNameFilters(filters);
						QStringList files = chosenDir.entryList();

						foreach (QString file, files)
						{
							filenames << (dirString+file);
							displayNames << (dirString+item);
							//omfCache.push_back(readOMF((dirString+file).toStdString(), tempHeader));
						}

					} else {